import request from '@/utils/request'; // 已封装的 request 方法

// 授权链接
export function getAuthLink(params) {
  return request({
    url: '/business/visitor/authorized_link',
    method: 'get',
    params
  })
}

// token
export function getToken(params) {
  return request({
    url: '/business/visitor/token',
    method: 'get',
    params
  })
}

// 下单接口
export function createOrder(projectId, data) {
  return request({
    url: `/pay/v3/createOrder/${projectId}`,
    method: 'post',
    data
  })
}

// 查询用户信息 获取支付订单状态
export function visitorInfo() {
  return request({
    url: '/business/visitor/info',
    method: 'get'
  })
}

// 查询用户信息 获取支付订单状态
export function getProjectInfoApi(id) {
  return request({
    url: `/business/project/${id}`,
    method: 'get'
  })
}